Question: Evaluate $~~\int x\cos(\pi x)dx\,$. Choose 1 answer: Choose 1 answer: (Choice A) A $\dfrac{x\sin(\pi x)+\cos(\pi x)}{\pi^2}+C$ (Choice B) B $\dfrac{\sin(\pi x)+\cos(\pi x)}{\pi^2}+C$ (Choice C) C $\dfrac{x\sin(\pi x)}{\pi}+\dfrac{\cos(\pi x)}{\pi^2}+C$ (Choice D) D $\dfrac{\sin(\pi x)}{\pi}+\dfrac{\cos(\pi x)}{\pi^2}+C$
Answer: We will solve this by integrating by parts. We know that $ \int u(x)v\,^\prime(x)dx = u(x)v(x)-\int u\,^\prime(x)v(x)dx\,$. We can rewrite this as $ \int u\ dv = uv-\int v\ du\,$. In this problem we will let $~u = x~$ and $~dv=\cos(\pi x) \,dx\,$. Then $~du = dx~$ and $ ~v =\int\cos(\pi x)\,dx= \dfrac{\sin(\pi x)}\pi\,$. Integration by parts gives $~ \int x\cos(x)\ dx = \dfrac{x\sin(\pi x)}{\pi}-\int\dfrac{\sin(\pi x)}{\pi}\,dx$ $ \,= \dfrac{x\sin(\pi x)}{\pi}-\frac1{\pi}\Big(-\dfrac{\cos(\pi x)}{\pi}\Big)$ $ = \dfrac{x\sin(\pi x)}{\pi}+\dfrac{\cos(\pi x)}{\pi^2}+C\,$.